package edu.unindra.elearning.util;

import javax.swing.JDialog;

import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

import usu.widget.Form;
import edu.unindra.elearning.form.addin.ElearningFormSubMainMateriSoal;

public class AddressDialog extends JDialog {
	JLabel label1 = new JLabel("Address");

	JLabel label2 = new JLabel("City");

	JLabel label3 = new JLabel("State");

	JLabel label4 = new JLabel("Zip Code");

	JTextField addressField = new JTextField();

	JTextField cityField = new JTextField();

	JTextField stateField = new JTextField();

	JTextField zipCodeField = new JTextField();

	String[] address = new String[4];

	public AddressDialog() {
		init();
	}

	public AddressDialog(
			ElearningFormSubMainMateriSoal elearningFormSubMainMateriSoal,
			boolean modal) {
		init();
	}

	private void init() {
		setLocationRelativeTo(null);
		setMinimumSize(new Dimension(450, 225));
		java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit()
				.getScreenSize();
		setBounds((screenSize.width - 400) / 2, (screenSize.height - 200) / 2,
				800, 600);

		this.setTitle("Address Dialog");
		getContentPane().setLayout(new GridLayout(4, 2));
		getContentPane().add(label1);
		getContentPane().add(addressField);
		getContentPane().add(label2);
		getContentPane().add(cityField);
		getContentPane().add(label3);
		getContentPane().add(stateField);
		getContentPane().add(label4);
		getContentPane().add(zipCodeField);

	}

	public String[] getAddress() {
		address[0] = addressField.getText();

		address[1] = cityField.getText();
		address[2] = stateField.getText();
		address[3] = zipCodeField.getText();
		return address;
	}
}
